﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using AbpDemo.Domain.Goods;

namespace AbpDemo.Domain.Orders
{
    /// <summary>
    /// 订单项
    /// </summary>
    [Table("OrderItem")]
    public class OrderItem_1:CreationAuditedEntity<Guid>
    {
        /// <summary>
        /// 订单id
        /// </summary>
        [Required]
        public Guid OrderId { get; set; }
        public Order_1 Order { get; set; }
        /// <summary>
        /// 商品id
        /// </summary>
        [Required]
        [ForeignKey("Goods")]
        public Guid GoodsId { get; set; }
        public Goods_1 Goods { get; set; }
        /// <summary>
        /// 商品数量
        /// </summary>
        [Required]
        [Range(0,int.MaxValue)]
        public int Amount { get; set; }
        /// <summary>
        /// 合计金额
        /// </summary>
        [Required]
        public decimal SumAmount { get; set; }
    }
}
